package com.example.demo.utils;

/**
 * 此枚举类只用于自定义的HTTP状态码，
 * 标准状态码请使用org.springframework.http.HttpStatus枚举类。
 *
 * @author c10709
 */
public enum HttpCode {
    /**
     * 特殊异常，用于前端特殊处理
     */
    SPECIAL_ERROR(700,"前端特殊处理");

    private final int value;
    private final String reasonPhrase;

    HttpCode(int value, String reasonPhrase) {
        this.value = value;
        this.reasonPhrase = reasonPhrase;
    }

    public int value() {
        return this.value;
    }

    public String getReasonPhrase() {
        return this.reasonPhrase;
    }

    @Override
    public String toString() {
        return Integer.toString(this.value);
    }
}
